import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpPageApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpDetailApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpSaveApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpEditApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpEditStatusApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpRemoveApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};

/**
 * 导出模版
 * @returns 返回Promise对象
 */
export const wechatConfigMpExportTemplateApi = () => {
    return request({
        url: '/api/setup/wechat/config/mp/exportTemplate',
        method: 'get',
        responseType: 'blob',
        isLoading: true
    });
};

/**
 * 导入
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMpImportByTemplateApi = query => {
    return request({
        url: '/api/setup/wechat/config/mp/importByTemplate',
        method: 'post',
        data: query,
        responseType: 'blob',
        isLoading: true
    });
};
